(define (enum-int a b)
  (if (> a b)
      '()
      (cons a (enum-int (+ a 1) b))))

(enum-int 1 5)				; -> (1 2 3 4 5)
(enum-int 1 1)				; -> (1)
(enum-int 1 0)				; -> ()

(define (acc op init seq)
  (if (null? seq)
      init
      (op (car seq)
	  (acc op init (cdr seq)))))

(define (flatmap proc seq)
  (acc append '() (map proc seq))
	 
;; (define (f n)
;;   (acc append
;; 	      '()
;; 	      (map (lambda (j) 
;; 		     (map (lambda (i) 
;; 			    (list i j))
;; 			  (enum-int (+ j 1) n)))
;; 		   (enum-int 1 (- n 1)))))


